﻿<%@ Page Title="" Language="C#" MasterPageFile="~/adminpages/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="ManageFAQ.aspx.cs" Inherits="adminpages_ManageFAQ" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="faq_ID" DataSourceID="SqlDataSourceFAQ" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="faq_ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="faq_ID" />
            <asp:BoundField DataField="faq_question" HeaderText="question" SortExpression="faq_question" />
            <asp:BoundField DataField="faq_answer" HeaderText="answer" SortExpression="faq_answer" />
        </Columns>
        <EditRowStyle BackColor="#7C6F57" />
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F8FAFA" />
        <SortedAscendingHeaderStyle BackColor="#246B61" />
        <SortedDescendingCellStyle BackColor="#D4DFE1" />
        <SortedDescendingHeaderStyle BackColor="#15524A" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSourceFAQ" runat="server" ConnectionString="<%$ ConnectionStrings:EnviromentSurvey_S3ConnectionString %>" DeleteCommand="DELETE FROM [FAQs] WHERE [faq_ID] = @faq_ID" InsertCommand="INSERT INTO [FAQs] ([faq_question], [faq_answer]) VALUES (@faq_question, @faq_answer)" SelectCommand="SELECT [faq_ID], [faq_question], [faq_answer] FROM [FAQs]" UpdateCommand="UPDATE [FAQs] SET [faq_question] = @faq_question, [faq_answer] = @faq_answer WHERE [faq_ID] = @faq_ID">
        <DeleteParameters>
            <asp:Parameter Name="faq_ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="faq_question" Type="String" />
            <asp:Parameter Name="faq_answer" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="faq_question" Type="String" />
            <asp:Parameter Name="faq_answer" Type="String" />
            <asp:Parameter Name="faq_ID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

